package protocol.transactions;

import protocol.XoneProtocol;
import protocol.XoneServiceCode;

import com.netease.http.THttpRequest;

public class TransactionReport extends XoneBaseTransaction {
    private int mType;
    private String mInfoId;
    private String mMessage;

    public TransactionReport(String infoId, int type, String message) {
        super(TRANSACTION_TYPE_REPORT);
        
        mType = type;
        mInfoId = infoId;
        mMessage = message;
    }

    @Override
    protected void onXoneTransactionSuccess(int code, Object obj) {
        notifyMessage(XoneServiceCode.TRANSACTION_SUCCESS, null);
    }

    @Override
    public void onTransact() {
        THttpRequest request = XoneProtocol.getInstance().createReport(mInfoId, mType, mMessage);
        sendRequest(request);
    }
}
